home *** CD-ROM | disk | FTP | other *** search
Wrap
Text File | 1992-11-18 | 51.5 KB | 1,494 lines | [ TEXT/MPS ]
C.S.M.P. Digest Sat, 14 Mar 92 Volume 1 : Issue 16 Today's Topics: Sockets now avaiable PowerOpen C++ for the Mac Sending FileSpecifications ResEdit 2.1 Bundle Bit and Custom Icon Woes getting Vrefnum without using StdGetFile Location 0 (Was Re: Blinking box on my screen) Think debugger BUG? WARNING: Bug in THINK Pascal 4.0.1 FILE *'s and Mac files MPW: deleting resource fork Launching Applications GetMenu returning wrong ID? Resolving aliases for pref files etc finding a publisher The Comp.Sys.Mac.Programmer Digest is moderated by Michael A. Kelly. These digests are available (by using FTP, account anonymous, your email address as password) in the pub/mac/csmp-digest directory on ftp.cs.uoregon. edu (try skinner.cs.uoregon.edu if that doesn't work). This is also the home of the comp.sys.mac.programmer Frequently Asked Questions list. These digests are also available via email. Just send a note saying that you want to be on the digest mailing list to mkelly@cs.uoregon.edu, and you will automatically receive each new digest as it is created. The articles in these digests are taken directly from comp.sys.mac.programmer. They are not edited; all articles included in this digest are in their original posted form. The only articles that are -not- included in these digests are those which didn't receive any replies (except those that give information rather than ask a question). All replies to each article are concatenated onto the original article in the order in which they were received. Article threads are not added to the digests until the last article added to the thread is at least one month old (this is to ensure that the thread is dead before adding it to the digests). Send administrative mail to mkelly@cs.uoregon.edu. ------------------------------------------------------- From: creiman@ncsa.uiuc.edu (Charlie Reiman) Subject: Sockets now avaiable Organization: University of Illinois at Urbana Date: Wed, 12 Feb 1992 02:53:21 GMT Brief announcement: The Mac socket library is finally available from ftp.ncsa.uiuc.edu, the official NCSA ftp server. It is in the directory /misc/unsupported. Please take special note of the location. It is _not_ in the /Mac subdirectory! Also, it is in _unsupported_, because it is definately unsupported. For the newcomers: This is a library for MPW 3.2, witten in C, that is designed to emulate most of the functionality of BSD sockets with regard to TCP/IP communications. Please note it will not allow you to develop anything if you do not have a copy of APDA's MacTCP toolkit. Also note I do not have a THINK C version. If someone ports it over to THINK, please drop me a line as to exactly what changes you needed to make so I can include a note in the README of future versions. This is the February '92 release. It is the first one in a long time to make an attempt at UDP support. Have at it, folks. Server: ftp.ncsa.uiuc.edu (141.142.20.50) File: /misc/unsupported/Socket.sit.hqx Author: creiman@ncsa.uiuc.edu -- Charlie Reiman - creiman@ncsa.uiuc.edu Submissions to RHF: 3 Times published in RHF: 4 --------------------------- From: gmarzot@mitre.org (G. S. Marzot (Joe)) Subject: PowerOpen Date: 30 Jan 92 16:49:24 GMT Organization: The MITRE Corporation This may be a little early to ask, but I have been reading articles that talk about a forum for people interested in PowerOpen, the new Apple/IBM OS for the RISC based PowerPC. Is there any info out there...possibly who at Apple should be contacted Thanks for any Info -GSM Email: gmarzot@linus.mitre.org (standard disclaimer) - ------------------------- From: ksand@apple.com (Kent Sandvik) Subject: PowerOpen Date: 2 Feb 92 23:39:23 GMT Organization: MacDTS Mongols In article <1992Jan30.164924.7764@linus.mitre.org>, gmarzot@mitre.org (G. S. Marzot (Joe)) writes: > > This may be a little early to ask, but I have been reading articles that > talk about a forum for people interested in PowerOpen, the new Apple/IBM > OS for the RISC based PowerPC. Is there any info out there...possibly who > at Apple should be contacted Thanks for any Info > -GSM Latest Byte had a story about the IBM/Apple alliance, including PowerOpen. As for more information, I'm sure the trade press, especially the UNIX one, will provide both real information and rumor mill stuff. Kent Sandvik - ---------- (create-a-.signature-please) - ------------------------- From: gmarzot@mitre.org (G. S. Marzot (Joe)) Subject: PowerOpen Date: 4 Feb 92 13:33:27 GMT Organization: The MITRE Corporation In article <19794@goofy.Apple.COM> ksand@apple.com (Kent Sandvik) writes: > In article <1992Jan30.164924.7764@linus.mitre.org>, gmarzot@mitre.org (G. S. Marzot (Joe)) writes: > > > > This may be a little early to ask, but I have been reading articles that > > talk about a forum for people interested in PowerOpen, the new Apple/IBM > > OS for the RISC based PowerPC. Is there any info out there...possibly who > > at Apple should be contacted Thanks for any Info > > -GSM > > Latest Byte had a story about the IBM/Apple alliance, including PowerOpen. > As for more information, I'm sure the trade press, especially the UNIX one, > will provide both real information and rumor mill stuff. This does not sound like a very open policy for Apple to have budding developers seek information in the form of rumors. I thought the whole point of this new OS was to be open, you know like Power - OPEN. Isn't there a more direct channel for info. How does OSF/1 fit in? I thought I remembered hearing something about a developer program for PowerOpen. Thanks you for any more concrete information. - GSM Email: gmarzot@linus.mitre.org (standard disclaimer) - ------------------------- From: neeri@iis.ethz.ch (Matthias Ulrich Neeracher) Subject: PowerOpen Organization: Integrated Systems Laboratory, ETH, Zurich Date: 6 Feb 92 19:41:08 In article <1992Feb4.133327.8680@linus.mitre.org> gmarzot@mitre.org (G. S. Marzot (Joe)) writes: >This does not sound like a very open policy for Apple to have budding >developers seek information in the form of rumors. I thought the whole >point of this new OS was to be open, you know like Power - OPEN. You don't want to be locked into Open operating systems anyway :-) >How does OSF/1 fit in? Good question. Does OSF fit in anywhere ? I remember being at a HP press conference in Switzerland where it was announced, but that was like 5 years ago. OSF/1 seems to be shipping, but I haven't seen any company betting its future on it yet. But maybe I'm misunderstanding the OSF's motives, anyway. Matthias - --- Matthias Neeracher neeri@iis.ethz.ch "... Rice walked out wondering if the world was nothing but wimps, pimps, psychos and sex fiends" -- James Ellroy, _Suicide Hill_ - ------------------------- From: Thad.Humphries@p950.f70.n109.z1.FidoNet.Org (Thad Humphries) Subject: PowerOpen Date: 07 Feb 92 06:26:59 EST MU> From: neeri@iis.ethz.ch (Matthias Ulrich Neeracher) MU> Newsgroups: comp.sys.mac.programmer MU> Organization: Integrated Systems Laboratory, ETH, Zurich MU> Reply-To: gmarzot@mitre.org's message of 4 Feb 92 13:33:27 GMT ... MU> >How does OSF/1 fit in? MU> MU> Good question. Does OSF fit in anywhere ? Are we talking about the Open Software Foundation? If so, their claim to fame in my eye is as the sponsors of OSF/MOTIF, the most popular window manager and widget set for X Windows. That may change, though: AT&T and SUN, who sponsor OPEN LOOK, have decided to bundle XView (an OPEN LOOK compliant widget set) with all UNIX V R.4. At least I hope -- my boss is shelling out lots for SUN SPARCstations and schooling for us hacks. Besides, MOTIF looks too much like Windows -- reason enough for me to hate it but likely to stay commercially popular. If only I could get XView libraries on a Mac at a reasonable price... * Origin: Quis custodiet ipsos custodes? (1:109/70.950) - ------------------------- From: tmaehl@vax1.umkc.edu Subject: PowerOpen Date: 11 Feb 92 08:03:36 GMT Organization: University of Missouri Computing Services > > Good question. Does OSF fit in anywhere ? I remember being at a HP press > conference in Switzerland where it was announced, but that was like 5 years > ago. OSF/1 seems to be shipping, but I haven't seen any company betting its > future on it yet. But maybe I'm misunderstanding the OSF's motives, anyway. Digital at least seems to be putting all its eggs into OSF/1. They are now shipping OSF/1 on their unix platforms, they are supplying the same code to be the basis of SCO's unix for ACE compliant platforms, and have ported it to their unreleased "Alpha" platforms (100-200MHz risc chips). As for POWER/Open, as I understand it IBM is supposed to base AIX on OSF/1, and hence POWER/Open will be (at some level?) OSF/1 compatible. OSF/1 requires the Motif interface, which will I believe, be supported along with the Apple UI on POWER/Open. Jonathan/tmaehl@vax1.umkc.edu --------------------------- From: bruss@beowulf.ucsd.edu (Brian Russ) Subject: C++ for the Mac Date: 4 Feb 92 03:14:48 GMT Organization: CSE Dept., UC San Diego - ------------------------- Brian -- Brian Russ CSE Department, UC San Diego ..!sdcsvax!bruss - ------------------------- From: alana@dogmatix.cs.uoregon.edu (Thomas Alan Akins) Subject: C++ for the Mac Organization: University of Oregon Computer and Information Sciences Dept. Date: Tue, 4 Feb 1992 19:59:05 GMT In article <28167@sdcc12.ucsd.edu> bruss@beowulf.ucsd.edu (Brian Russ) writes: > > From what I've gathered, if I want to program in C++ on the Mac, >I want to get MPW. The question is, I can't find it anywhere. >Where might one find it? > > Brian I believe you can purchase it from the Apple Product Developer's Associtation. Information and current price lists are available from ftp.apple.com. -- * Alan Akins * * "I could say 'addition' alana@cs.uoregon.edu * * when I mean ... 'basketball.'" University of Oregon * * - E. Tick Department of Computer Science * - ------------------------- From: rickf@Apple.COM (Rick Fleischman) Subject: C++ for the Mac Date: 6 Feb 92 18:11:59 GMT Organization: Apple Computer Inc., Cupertino, CA In article <28167@sdcc12.ucsd.edu> bruss@beowulf.ucsd.edu (Brian Russ) writes: > > From what I've gathered, if I want to program in C++ on the Mac, >I want to get MPW. The question is, I can't find it anywhere. >I've looked over the various mail-order places in MacWorld and MacUser >(Mac Zone, Mac Connection, others) and there is absolutely no mention >of MPW (or any other C++) at all. Is there a reason for this? >Where might one find it? > > Brian >-- >Brian Russ >CSE Department, UC San Diego >..!sdcsvax!bruss MPW and C++, as well as all other Apple-published development tools are available through APDA, Apple's mail order channel for development tools and technical documentation. You can reach APDA at: (800) 282-2732 (in the U.S.) (800) 637-0029 (in Canada) (408) 562-3910 (International) via the mail at: APDA Apple Computer, Inc. 20525 Mariani Avenue, M/S 33-G Cupertino, CA 95014 or via e-mail at: APDA@applelink.apple.com They will send you a free APDA Tools Catalog. Rick Fleischman MPW Product Manager Apple Computer, Inc. e-mail: rickf@apple.com AppleLink: FLEISCHMAN@applelink.apple.com - ------------------------- From: lee@wang.com (Lee Story) Subject: C++ for the Mac Date: 13 Feb 92 23:10:03 GMT Organization: Wang Laboratories, Inc. In article <1992Feb4.195905.12992@cs.uoregon.edu> alana@dogmatix.cs.uoregon.edu (Thomas Alan Akins) writes: Path: wang!uunet!uunet!elroy.jpl.nasa.gov!swrinde!mips!cs.uoregon.edu!dogmatix.cs.uoregon.edu!alana From: alana@dogmatix.cs.uoregon.edu (Thomas Alan Akins) Newsgroups: comp.sys.mac.programmer Date: 4 Feb 92 19:59:05 GMT References: <28167@sdcc12.ucsd.edu> Sender: news@cs.uoregon.edu (Netnews Owner) Organization: University of Oregon Computer and Information Sciences Dept. Lines: 17 In article <28167@sdcc12.ucsd.edu> bruss@beowulf.ucsd.edu (Brian Russ) writes: > > From what I've gathered, if I want to program in C++ on the Mac, >I want to get MPW. The question is, I can't find it anywhere. >Where might one find it? > > Brian I believe you can purchase it from the Apple Product Developer's Associtation. Information and current price lists are available from ftp.apple.com. Call APDA at 1-800-282-2732 for ordering info. I believe MPW plus C++ is in the $300 to $400 range. (don't have my catalog here) -- - ---------------------------------------------------------------------- Lee Story (lee@wang.com) Wang Laboratories, Inc. (Boston and New Hampshire AMC, and Merrimack Valley Paddlers) - ---------------------------------------------------------------------- --------------------------- From: ollef@sics.se (Olle Furberg) Subject: Sending FileSpecifications Date: 2 Feb 92 19:20:57 GMT Organization: Satellite Image in Kiruna Corporation I'm constructing a program which will work as a background only subprocess and managed by another program, hereafter called "master program", through IAC (interapplication communication). The program will be launched by the master (through the process manager, or Finder events if they are on different machines). The master program will send a highlevel event to my program together with a reference to a file which my program will have to open, do some work, and then return the result to the master (through IAC). My main concern is what sort of file specification I should use. If both programs are running on the same computer, a FSSpec will do the job. But, what if the two programs is not running on the same Mac? If the master sends an Alias to my process on the other Mac, will it be able to resolve this alias (created on another machine) and try to mount the other Mac's volume through filesharing? /Olle - ---------------------------------------------------------- Olle Furberg Internet: ollef@sics.se Satellitbild in Kiruna Phone: +46 980 121 40 Swedish Space Corporation Fax: +46 980 160 44 Home: +46 980 801 95 - ------------------------- From: grobbins@Apple.COM (Grobbins) Subject: Sending FileSpecifications Date: 7 Feb 92 06:13:47 GMT Organization: Apple DTS In article <1992Feb2.192057.29723@sics.se> ollef@sics.se (Olle Furberg) writes: >The master program will send a highlevel event to my program together >with a reference to a file which my program will have to open, do some >work, and then return the result to the master (through IAC). >... >If the master sends an Alias to my process on the other Mac, will it be >able to resolve this alias (created on another machine) and try to mount >the other Mac's volume through filesharing? Yep, that's the ticket. Full alias records can be handed off to any other Mac on the network. As Inside Mac VI says on page 27-4, An alias record is a reliable way to identify a file system object when your application is communicating with a process that might be running on a different machine. Because your server app is a faceless background puppy, you will have to make certain that it does not bring up the user validation dialog when mounting a remote volume. Call GetAliasInfo if you want to see where the alias points to, and use MatchAlias rather than ResolveAlias to get full control of the alias resolution. Grobbins grobbins@apple.com Usual disclaimers apply. - ------------------------- From: smoke@well.sf.ca.us (Nicholas Jackiw) Subject: Sending FileSpecifications Date: 10 Feb 92 19:49:13 GMT Organization: Whole Earth 'Lectronic Link, Sausalito, CA In article <1992Feb2.192057.29723@sics.se> ollef@sics.se (Olle Furberg) writes: >The master program will send a highlevel event to my program together >with a reference to a file which my program will have to open, do some >work, and then return the result to the master (through IAC). > >My main concern is what sort of file specification I should use. If >both programs are running on the same computer, a FSSpec will do the >job. But, what if the two programs is not running on the same Mac? > >If the master sends an Alias to my process on the other Mac, will it be >able to resolve this alias (created on another machine) and try to mount >the other Mac's volume through filesharing? Yes. I use exactly this scheme. You can even have the Apple Event manager coerce the sent alias into an FSSpec for you. However, recall that logging onto a fileshared volume requires user interaction, even if no password (Guest privileges) are enabled. If there's no user there, your remote mac will freeze at the password stage unless you have already explicitly mounted the shared folder on it. As of the present time, there's no work around for this (allegedly, there's an init on one of the developer cds, but no Official Workaround). -- --- * --- Nick Jackiw Smoke@well.sf.ca.us | Jackiw@cs.swarthmore.edu Key Curriculum Press, Inc. Applelink:KEY.EDUSOFT | (415) 548-2304 --- * --- - ------------------------- From: lai@Apple.COM (Ed Lai) Subject: Sending FileSpecifications Date: 11 Feb 92 00:15:02 GMT Organization: Apple Computer Inc., Cupertino, CA In article <29934@well.sf.ca.us> smoke@well.sf.ca.us (Nicholas Jackiw) writes: >Yes. I use exactly this scheme. You can even have the Apple Event >manager coerce the sent alias into an FSSpec for you. However, recall >that logging onto a fileshared volume requires user interaction, even >if no password (Guest privileges) are enabled. If there's no user there, >your remote mac will freeze at the password stage unless you have already >explicitly mounted the shared folder on it. As of the present time, >there's no work around for this (allegedly, there's an init on one of >the developer cds, but no Official Workaround). > > This is not true. If you have the Apple Event manager coerce the alias to fss for you using the built-in coercion handler, then if you specify no user-interaction (the default when you send it to a remote machine) in your Apple Event, it would not try to interact and it would just return an error. /* Disclaimer: All statments and opinions expressed are my own */ /* Edmund K. Lai */ /* Apple Computer, MS37-UP */ /* 20525 Mariani Ave, */ /* Cupertino, CA 95014 */ /* (408)974-6272 */ zW@h9cOi - ------------------------- From: smoke@well.sf.ca.us (Nicholas Jackiw) Subject: Sending FileSpecifications Date: 13 Feb 92 21:55:25 GMT Organization: Whole Earth 'Lectronic Link, Sausalito, CA In article <62662@apple.Apple.COM> lai@Apple.COM (Ed Lai) writes: >In article <29934@well.sf.ca.us> smoke@well.sf.ca.us (Nicholas Jackiw) writes: >> [...] >>If there's no user there, >>your remote mac will freeze at the password stage unless you have already >>explicitly mounted the shared folder on it. As of the present time, >>there's no work around for this (allegedly, there's an init on one of >>the developer cds, but no Official Workaround). >This is not true. If you have the Apple Event manager coerce the alias to >fss for you using the built-in coercion handler, then if you specify no >user-interaction (the default when you send it to a remote machine) in >your Apple Event, it would not try to interact and it would just return >an error. >/* Edmund K. Lai */ You're correct, of course, if userInteraction is turned off. If, on the other hand, you assume that the reason Mac A is sending Mac B a filespec is so that Mac B can actually *do* something with or to the file, then what I said remains: there's no way you can get to the file without either previously mounting the shared volume or having a user there to click on the "guest" button. Returned errors are nice compared to crashes, but they're still a far cry from useful results. -- --- * --- Nick Jackiw Smoke@well.sf.ca.us | Jackiw@cs.swarthmore.edu Key Curriculum Press, Inc. Applelink:KEY.EDUSOFT | (415) 548-2304 --- * --- --------------------------- From: leue@galen.crd.ge.com (Bill Leue) Subject: ResEdit 2.1 Bundle Bit and Custom Icon Woes Date: 10 Feb 92 14:40:13 GMT Organization: General Electric Research & Development Has anyone else had the kind of problems I am having with ResEdit 2.1, trying to create a custom icon for an application? Here's a brief summary: 1. I create the 'ICN#' resource, ID 128, with all the various icons. 2. Create the 'BNDL' resource, ID 128, owner ID 'BILL', with one entry, 'APPL', which points to my 'ICN#' resource. The icons show up in the entry, just as they should. 3. I set the creator type of the application to 'BILL', the same as the owner line in the 'BNDL' resource. Checking the other resources, it appears that ResEdit has created the other resources such as 'FREF' and the Local ID's ok. I re-link the application and add the new resource file. (Did I mention that I'm using Think C 5.0?) Then I rebuild the desktop. Hmmm..... No custom icon, just the generic 'hand' icon. Checking the desktop files with ResEdit reveals that my custom icons have not been added. When I go back into the application's resource file with ResEdit, someone has changed my 'APPL' entry in the 'BNDL' resource back into '????'. Arggghhh! I've gone through this cycle (and variations) a number of times, but to no avail. I found out that if I add a second (dummy) line to 'BNDL', it seems to make it less likely that my 'APPL' entry will get changed back to '????', but this doesn't by itself help to get the custom icon to appear. Any guesses? This is happening using System 7.0 (with tune-up) on a 5 meg IIcx. Thanks! -Bill Leue leue@crd.ge.com - ------------------------- Subject: ResEdit 2.1 Bundle Bit and Custom Icon Woes From: russells@ccu1.aukuni.ac.nz (Russell Street) Date: Mon, 10 Feb 1992 19:23:37 GMT Organization: University of Auckland, New Zealand. leue@galen.crd.ge.com (Bill Leue) writes: >Has anyone else had the kind of problems I am having with ResEdit 2.1, trying >to create a custom icon for an application? Here's a brief summary: I believe it is a bug in ResEdit -- it does NOT WRITE OUT THE FREF RESOURCES WHEN YOU CHANGE THEM IN A BNDL. It drove me nuts figuring this one out. The only way around this is to go and change the FREFs manually to get them "changed" and written out. If you look at the FREF resources when while the file is still open the appear changed, but if you close and reopen the file they will be the old values. Curses and naughty words! - ------------------------------------------------------------ Russell Street (russells@ccu1.aukuni.ac.nz) It was the least I could do -- a quantity I specialize in. - ------------------------- Subject: ResEdit 2.1 Bundle Bit and Custom Icon Woes From: stanger@otago.ac.nz (Nigel Stanger) Date: 11 Feb 92 13:57:15 +1300 Organization: University of Otago, Dunedin, New Zealand In article <27199@crdgw1.crd.ge.com>, leue@galen.crd.ge.com (Bill Leue) writes: > Has anyone else had the kind of problems I am having with ResEdit 2.1, trying > to create a custom icon for an application? Here's a brief summary: > > 1. I create the 'ICN#' resource, ID 128, with all the various icons. > 2. Create the 'BNDL' resource, ID 128, owner ID 'BILL', with one entry, > 'APPL', which points to my 'ICN#' resource. The icons show up in the entry, > just as they should. > 3. I set the creator type of the application to 'BILL', the same as the owner > line in the 'BNDL' resource. [...] > Hmmm..... No custom icon, just the generic 'hand' icon. Checking the desktop > files with ResEdit reveals that my custom icons have not been added. When > I go back into the application's resource file with ResEdit, someone has > changed my 'APPL' entry in the 'BNDL' resource back into '????'. Arggghhh! You could try editing the BNDL resource with the BNDL template rather than the BNDL editor (i.e. choose "Open using template..." from the Resource menu). It's not as nice to use, but when I had similar problems with the BNDL editor I did this and it worked, so maybe it will for you too. -- See ya Nigel. - -------------------------------------------------------------------- Nigel Stanger, Internet: stanger@otago.ac.nz University of Otago, Phone: +64 3 479-8179 Dunedin, NEW ZEALAND. Fax: +64 3 479-8311 "ACK! Pthptttt!" -- Bill the Cat, "Bloom County" - ------------------------- From: matth@oakhill.sps.mot.com (Matthew Holle) Subject: ResEdit 2.1 Bundle Bit and Custom Icon Woes Organization: Motorola Inc., Austin, Texas Date: Tue, 11 Feb 1992 15:06:14 GMT In article <1992Feb10.192337.1708@ccu1.aukuni.ac.nz> russells@ccu1.aukuni.ac.nz (Russell Street) writes: >leue@galen.crd.ge.com (Bill Leue) writes: > >>Has anyone else had the kind of problems I am having with ResEdit 2.1, trying >>to create a custom icon for an application? Here's a brief summary: > > > >I believe it is a bug in ResEdit -- it does NOT WRITE OUT THE FREF RESOURCES >WHEN YOU CHANGE THEM IN A BNDL. It drove me nuts figuring this >one out. > >The only way around this is to go and change the FREFs manually to >get them "changed" and written out. > >If you look at the FREF resources when while the file is still open >the appear changed, but if you close and reopen the file they will be >the old values. > >Curses and naughty words! >-------------------------------------------------------------- >Russell Street (russells@ccu1.aukuni.ac.nz) > It was the least I could do -- a quantity I specialize in. Actually, I think another problem may be to blame. Here's the method I use to give my applications their own custom icons. 1. Use resedit to build an ICN# resource, then build the BNDL resource. At this point, when you input the Signature in the BNDL resource, you should see the icons appear in the window (ResEdit 2.1.1). 2. Here's where I think Bill Leue was having problems. You need to go into Think C (version whatever) and do a "Set Project Type..." under the Project menu. Set the project to be of type application, file type to be "APPL" and signature to the same signature you used in the BNDL resource in step one. 3. Recompile and rebuild the desktop and you should see an icon. I think Think C will overwrite the BNDL resource with the preferences you set up in the "Set Project Type..." menu (setting the signature back to "????". # include <std_disclaimer.h> ----------------------------------------------------------------------- | Matt Holle Motorola Microprocessor | | RISC Applications & Memory Technology Group | | (matth@oakhill.sps.mot.com) Austin, TX | ----------------------------------------------------------------------- --------------------------- From: jxs18@po.CWRU.Edu (Jerry Sy) Subject: getting Vrefnum without using StdGetFile Organization: Case Western Reserve University, Cleveland, OH (USA) Date: Mon, 10 Feb 92 17:15:11 GMT I want to create a file (or open a file) that I know the file name and where it is located. How can I get the vrefnum for that file without using the StdGetFile dialog box ? jerry - ------------------------- From: keith@Apple.COM (Keith Rollin) Subject: getting Vrefnum without using StdGetFile Date: 14 Feb 92 02:15:08 GMT Organization: Apple Computer Inc., Cupertino, CA In article <1992Feb10.171511.8200@usenet.ins.cwru.edu> jxs18@po.CWRU.Edu (Jerry Sy) writes: > >I want to create a file (or open a file) that I know the file name >and where it is located. How can I get the vrefnum for that file >without using the StdGetFile dialog box ? If you know where the file is, but don't know the vRefNum of the volume it's on, then presumably you know the name of the volume and the dirID of the directory the file is in. What you need to do is find the vRefNum for the volume with the name you have. Most people use PBGetVInfo with a negative ioVolIndex for this (I think that's the trick). -- - ---------------------------------------------------------------------------- Keith Rollin --- <Taligent .signature under construction> Disclaimer: Pretty soon, I really _won't_ be speaking for Apple... --------------------------- From: ABSURD@applelink.apple.com (Tim Dierks, ToyMeister, Cray abuser) Subject: Location 0 (Was Re: Blinking box on my screen) Date: 10 Feb 92 21:43:06 GMT Organization: MacDTS, Apple Computer In article <1992Feb7.184427.10307@cs.ucla.edu>, david@oahu.cs.ucla.edu (David Dantowitz) writes: > p.s. is it still valid to set memory location 0 to 'NIL!' to trap > invalid defs? Yes, but there are better values. Try $50FFC037. This does several things: 1) It's odd, so accesses to it fail on 68000 machines 2) It will cause a bus error on all current Macs with bus error hardware 3) It's an invalid instruction, so jumping to 0 will die immediately. Note that under System 7, the toolbox will change location 0 to point it into ROM. This is done because some applications are improperly written, and dereference location 0. It was decided that it would be best for this fault, taken alone, not to crash applications on a users system. For best results, install Even Better Bus Error on your development and testing machines; it will catch 95% of such problems. Tim Dierks MacDTS, but I speak for myself - ------------------------- From: creiman@ncsa.uiuc.edu (Charlie Reiman) Subject: Location 0 (Was Re: Blinking box on my screen) Organization: University of Illinois at Urbana Date: Tue, 11 Feb 1992 18:22:29 GMT ABSURD@applelink.apple.com (Tim Dierks, ToyMeister, Cray abuser) writes: : In article <1992Feb7.184427.10307@cs.ucla.edu>, david@oahu.cs.ucla.edu (David Dantowitz) writes: < stuff deleted> : Note that under System 7, the toolbox will change location 0 to point it : into ROM. This is done because some applications are improperly written, and Actually, I found this to be only half true. Near as I can figure it, System 7 reads in the value from 0 some time after boot up, remembers it, then periodically writes it back there. Under "clean" system 7, that value somehow, magically, gets set to ROMbase+64k (as you probably know) during init time. This is read in after init time then later written back on a periodic basis. The trick comes when you run EBBE. It initializes 0 to $50FF8001 at init time. System 7 reads this in, then writes it back periodically. EBBE does not need to continually write that value back to 0, system 7 will gleefully do so on its own. In case your wondering how the hell I figured all this out: I wrote my own version of EBBE that I could switch on or off without rebooting. Seemed like a great idea to me, except System 7 insisted on overwitting the value I wanted in 0 with whatever happened to be there during system startup. A few experiments with Macsbugs' 'SS 0' and StopINIT should prove enlightening to the curious. -- Charlie Reiman - creiman@ncsa.uiuc.edu Submissions to RHF: 3 Times published in RHF: 4 --------------------------- From: pittenger-laurence@CS.YALE.EDU (Laurence Arthur Pittenger) Subject: Think debugger BUG? Date: 10 Feb 92 22:17:50 GMT Organization: Yale University Computer Science Dept., New Haven, CT 06520-2158 Think C version: 5.0.2 System version: 7.0 + Machine: Mac IIci Usually when something screws up the debugger I assume it's the fault of my code. However I can't find the bug anywhere (which usually means it's obvious, but still). Also, this last time caused major problems, screwing up my hard drive. I had to re-install the system before I could use any of my files/applications again. So I figured I'd best pass it along. The problem has a consistent manifestation. It only happens after I've interrupted my program's execution to check a falue or something in the debugger. If I simply run the program via the debugger (but don't stop it at any point) this doesn't happen. After I've done that, the program continues to work fine. The problem only shows up *after* I've quit the program *and* the debugger. Shortly thereafter all the colors for the menubar icons, icons, folders, etc get screwed up. Usually I notice this when the menu bar's icons have turned into black blobs. However it doesn't always happen on the *first* redraw of the menu (as far as I can tell). It used to be that I could sometimes still run my program once or twice. Now it consistently causes this problem and bombs the next time I try to enter the debugger. Sometimes it even crashes when the think c program itself is running -- compiling or saving or suchlike. What always happen, when it does crash, is that I get dumped into MacsBug -- usually when I've tried to launch the debugger a second time. An "es" doesn't work; I just get dumped back into the debugger again. This last time, es sent the hard drive whirring briefly before it dumped me back to MacsBug. When I went to reboot, the Finder got as far as drawing the menu bar and desktop icons. Then those disappeared, the arrow changed to a watch, the disk whirred, and it drew them again. That kept happening. I tried rebuilding the desktop, to no avail. Again, it got as far as the menus/icons, and started looping/whirring endlessly. I was able to boot of a floppy, could see (and copy) all the files on the hard drive, however when I tried to start up any of the applications, it got as far as getting the application's name up in the center of the menubar before it froze. This happened for every application I tried. Also, it seemed to have lost track of think c, because when I 2ble-clicked on my project it said that it couldn't find the creator of that file. Finally, I reinstalled the system software. Only then could I successfully boot from the hard drive. Like I said, this may well be my code; heck, my project is over 1000K so there're any *number* of places one could be hiding. However this recent incident was so disasterous I thought I'd best pass it along in case (a) anyone recognizes this and can tell me what I'm screwing up, or (b) if it actually is symptomatic of something wrong w/ the think stuff, in which case whoever collects data on this kind of thing now has a little more info. Happy hacking all! LP -- Laurence A. Pittenger CSNET : pittenger-laurence@cs.yale.edu BITNET : pitlaua@yalevm , pittenger-laurence@yalecs - ------------------------- From: duga@merlin.cvs.rochester.edu (Brady Duga) Subject: Think debugger BUG? Date: 11 Feb 92 13:33:13 GMT Organization: Center for Visual Science, U. of Rochester In article <1992Feb10.221750.24433@cs.yale.edu> pittenger-laurence@CS.YALE.EDU (Laurence Arthur Pittenger) writes: > >After I've done that, the program continues to work fine. The problem >only shows up *after* I've quit the program *and* the debugger. > >Shortly thereafter all the colors for the menubar icons, icons, >folders, etc get screwed up. Usually I notice this when the menu >bar's icons have turned into black blobs. However it doesn't always >happen on the *first* redraw of the menu (as far as I can tell). > I've had similar problems. The screen colors were all wrong, and a peek at the monitors CDEV showed the first several colors to be a blend from white to black, which I thought odd since I wasn't using any interesting color code. After a few runs, the machine would eventually crash (I didn't have MacsBug loaded at the time, so the machine just froze). The problem was rare enough that I never tracked down the cause, and it has stopped altogether recently. Anyone else with a similar experience? --Brady (duga@cvs.rochester.edu) - ------------------------- From: wombat@claris.com (Scott Lindsey) Subject: Think debugger BUG? Date: 13 Feb 92 23:48:06 GMT Organization: Claris Corporation In article <1992Feb11.133313.7884@galileo.cc.rochester.edu>, duga@merlin.cvs.rochester.edu (Brady Duga) writes: > > In article <1992Feb10.221750.24433@cs.yale.edu> pittenger-laurence@CS.YALE.EDU (Laurence Arthur Pittenger) writes: > > > >After I've done that, the program continues to work fine. The problem > >only shows up *after* I've quit the program *and* the debugger. > > > >Shortly thereafter all the colors for the menubar icons, icons, > >folders, etc get screwed up. Usually I notice this when the menu > >bar's icons have turned into black blobs. However it doesn't always > >happen on the *first* redraw of the menu (as far as I can tell). > > > > Anyone else with a similar experience? > Yes, I've seen it also. I reported it to Symantec in beta versions of Think C 5.0, but it wasn't fixed. It's hard to nail down to a specific user/programmer action. -- Scott Lindsey <wombat@claris.com> --------------------------- From: peter@cujo.curtin.edu.au (Peter N Lewis) Subject: WARNING: Bug in THINK Pascal 4.0.1 Date: 11 Feb 92 03:35:55 GMT Organization: NCRPDA, Curtin University Hi All, When you upgrade to 4.0.1, be careful with code resources. When it updates (compresses) the project, it also kindly turns on the "Custom Header" flag in the Project Type options. This has the wholely pleasant effect of removing the jmp to your main code, and thus producing a resource that will simply go bang in a really helpful way when it gets called. You have been warned (I have been burned), Peter. ______________________________________________________________________ Peter N Lewis, NCRPDA, Curtin University peter@cujo.curtin.edu.au GPO Box U1987, Perth WA 6001, AUSTRALIA FAX: +61 9 367 8141 - ------------------------- From: slang@bnr.ca (Steven Langlois) Subject: WARNING: Bug in THINK Pascal 4.0.1 Date: 11 Feb 92 13:06:23 GMT Organization: Bell-Northern Research Ltd. In article <1992Feb11.033555.28808@cujo.curtin.edu.au>, peter@cujo.curtin.edu.au (Peter N Lewis) writes: |> When you upgrade to 4.0.1, be careful with code resources. When it |> updates (compresses) the project, it also kindly turns on the |> "Custom Header" flag in the Project Type options. This has the wholely |> pleasant effect of removing the jmp to your main code, and thus producing |> a resource that will simply go bang in a really helpful way when it gets |> called. |> I tried this with several code resource projects and couldn't reproduce this problem. Can you give any more details? I'm sure the people at Symantec would be interested. Steven Langlois ISDN Basic Rate Access Bell-Northern Research Internet: slang@bnr.ca --------------------------- From: steve@oceania.com (Steve Dakin) Subject: FILE *'s and Mac files Date: 11 Feb 92 01:34:01 GMT Organization: Oceania Health Care Systems Using THINK C 5.0.x: Is there a way to get a Mac file reference number from a FILE * that is used in standard C file I/O operations (e.g. fprintf) and vice versa? All comments, suggestion, references, etc. appreciated. -- Steve Dakin UIguy, company morale booster, Marillion worshipper steve@oceania.com Oceania Health Care Systems, Palo Alto, CA jester@oceania.com (415) 322-0127 (NeXT mail) I'm not a doctor, I just work for them. - ------------------------- From: phils@chaos.cs.brandeis.edu (Phil Shapiro) Subject: FILE *'s and Mac files Date: 12 Feb 92 02:37:26 GMT Organization: Symantec Corp. In article <1992Feb11.013401.2564@oceania.com> steve@oceania.com (Steve Dakin) writes: Using THINK C 5.0.x: Is there a way to get a Mac file reference number from a FILE * that is used in standard C file I/O operations (e.g. fprintf) and vice versa? In general, check out the FILE structure in the stdio.h header file. The structure fields are pretty mnemonic -- of course, they can change in a future release. Currently, you can use: FILE *fp; ... err = GetEOF(fp->refnum, &theEOF); /* or whatever */ Also, you may want to look at the code for __open() in fopen.c. -phil -- Phil Shapiro Technical Support Analyst Language Products Group Symantec Corporation Internet: phils@chaos.cs.brandeis.edu --------------------------- From: Thad.Humphries@p950.f70.n109.z1.FidoNet.Org (Thad Humphries) Subject: MPW: deleting resource fork Date: 11 Feb 92 04:46:57 GMT JD> From: doner@aero.org (John Doner) JD> Newsgroups: comp.sys.mac.programmer JD> Organization: The Aerospace Corporation, El Segundo, CA JD> JD> Can anyone tell me how to use MPW commands to delete just the JD> resource fork of a file? Don't know that it can be done. But here's some THINK C code to do it... /* delete a fork.c * * This code shows how to delete the resource and data forks of a file. */ #include <ResourceMgr.h> #include <FileMgr.h> #include <stdio.h> void main() { int refNum, err; /* The next three lines are used to delete the resource fork. They require * you include ResourceMgr.h */ refNum = OpenResFile("\pRENT-A-COMP:Misc ESSO:Junk:my_file"); CloseResFile(refNum); err = OpenRF("\pRENT-A-COMP:Misc ESSO:Junk:my_file", 0, &refNum); /* If you want to delete the data fork, the previous three lines and use the * FSOpen line below. You need not include ResourceMgr.h */ /* err = FSOpen("\pRENT-A-COMP:Applications:Microsoft Word 4.0", 0, &refNum); */ if (err) { printf("Cannot open file, error %d.\n", err); return; } err = SetEOF(refNum, 0); if (err) { printf("Cannot set EOF, error %d.\n", err); return; } err = FSClose(refNum); if (err) { printf("Cannot close file, error %d.\n", err); return; } } * Origin: Quis custodiet ipsos custodes? (1:109/70.950) - ------------------------- From: nebel@wam.umd.edu (Chris D. Nebel) Subject: MPW: deleting resource fork Organization: University of Maryland at College Park Date: Tue, 11 Feb 1992 19:19:50 GMT Try "rez -o file < Dev:Null". Works for me. Admittedly, what this actually does is make the file have an empty resource fork, which is a little different than making it have NO resource fork, but it will still save you disk space. This command relies on the fact that rez initializes the resource fork of the target file before rezzing anything into it (unless you specify -a); getting input from Dev:Null means that nothing gets added, and voila! an empty resource fork. Chris Nebel nebel@wam.umd.edu --------------------------- From: costello@gandhi.cs.clemson.edu (E Gasparini) Subject: Launching Applications Organization: Clemson University Computer Science Dept. Date: Tue, 11 Feb 1992 17:54:09 GMT Hi, I need to know how to create (text|binary) data files within a Symantec Think Pascal application, and be able to launch this application (not Think Pascal) by 2-clicking on the data file. Please, be specific as my knowledge of the Mac OS is NIL (ok, close to that). Reply by e-mail, or post here. Thanks ================================ Elvis Gasparini costello@cs.clemson.edu Clemson University - ------------------------- From: gluttony@reed.edu!gluttony.reed.edu!pcalahan (Patrick John Calahan) Subject: Launching Applications Date: 13 Feb 92 07:25:35 GMT Organization: Reed College, Portland, OR In article <1992Feb11.175409.9114@hubcap.clemson.edu> costello@gandhi.cs.clemson.edu (E Gasparini) writes: > > Hi, > > I need to know how to create (text|binary) data files within a Symantec Think > Pascal application, and be able to launch this application (not Think Pascal) > by 2-clicking on the data file. > > Please, be specific as my knowledge of the Mac OS is NIL (ok, > close to that). > > Reply by e-mail, or post here. > Thanks > ================================ > Elvis Gasparini > costello@cs.clemson.edu > Clemson University Assuming I understand your question correctly... When you double click on a document file, the finder looks at its 'creator' field and searches for an APPLication of that type. All you need to do is pass your application's resource-signature through the 'creator' parameter of whatever file i/o routines you are using, or perhaps this is handled automatically. -Pat --------------------------- From: mlindholm@cc.helsinki.fi Subject: GetMenu returning wrong ID? Date: 11 Feb 92 18:17:23 GMT Organization: University of Helsinki I would be very grateful if someone helped me a little: I am writing a small drawing application with THINK C 5.0 using TCL. I created a new MENU resource with ResEdit (2.1) and gave it an ID 20. Then I added the commands and their numbers and finally added the menu ID in the MBAR resource. When running the application my menu commands never came through. So I watched with the debugger, and what did I see? When the Bartender is initializing itself, it makes a call of GetMenu to every menu in the MBAR resource. According to IM I-419, the GetMenu is supposed to return the menu record of the menu, whose ID is given as a parameter. All the other menus come out ok, but when my menu was called (with the ID 20), back came a menu record with an ID of 128. This is of course the reason why the commands were never sent, but how is this possible? And what should I do now? Yours, Mikko Lindholm mlindholm@cc.helsinki.fi mlindhol@finuh.bitnet - ------------------------- From: keith@Apple.COM (Keith Rollin) Subject: GetMenu returning wrong ID? Date: 14 Feb 92 03:28:54 GMT Organization: Apple Computer Inc., Cupertino, CA In article <1992Feb11.201723.1@cc.helsinki.fi> mlindholm@cc.helsinki.fi writes: > > I am writing a small drawing application with > THINK C 5.0 using TCL. I created a new MENU > resource with ResEdit (2.1) and gave it an ID 20. > Then I added the commands and their numbers and > finally added the menu ID in the MBAR resource. > > When running the application my menu commands never > came through. So I watched with the debugger, and > what did I see? When the Bartender is initializing > itself, it makes a call of GetMenu to every menu in > the MBAR resource. According to IM I-419, the GetMenu > is supposed to return the menu record of the menu, whose > ID is given as a parameter. All the other menus come > out ok, but when my menu was called (with the ID 20), > back came a menu record with an ID of 128. > > This is of course the reason why the commands were never > sent, but how is this possible? And what should I do now? It is probable that you changed only the resource ID of the MENU, and not the menu ID. Both must be changed in order for TCL's command handling to work. To change the menu ID, open the MENU resource, go to the MENU menu, and select Edit Menu and MDEF ID. -- - ---------------------------------------------------------------------------- Keith Rollin --- <Taligent .signature under construction> Disclaimer: Pretty soon, I really _won't_ be speaking for Apple... --------------------------- Subject: Resolving aliases for pref files etc From: russells@ccu1.aukuni.ac.nz (Russell Street) Date: Wed, 12 Feb 1992 02:10:01 GMT Organization: University of Auckland, New Zealand. Should one resolve aliases for preferences files, folders found by FindFolder found etc? The Finder does not, for instance do this, for instance if you put an alias called "Finder Preferences" in the Prefs folder. Should the rest of us bother? It is a fairly perverse thing for a user to do, but you never know what they will get up to. Also does the System resolve aliases for folders found by FindFolder? Again it is a silly thing for someone to do... TIA - ----------------------------------------------------------- Russell Street russells@ccu1.aukuni.ac.nz "Baldrick, I believe the phrase rhymes with 'clucking bell'." -- Edmund Blackadder - ------------------------- From: kaufman@Xenon.Stanford.EDU (Marc T. Kaufman) Subject: Resolving aliases for pref files etc Organization: CS Department, Stanford University, California, USA Date: 12 Feb 92 04:29:19 GMT russells@ccu1.aukuni.ac.nz (Russell Street) writes: >Should one resolve aliases for preferences files, folders found by >FindFolder found etc? >The Finder does not, for instance do this, for instance if you >put an alias called "Finder Preferences" in the Prefs folder. >Should the rest of us bother? It is a fairly perverse thing for >a user to do, but you never know what they will get up to. Under the principle of least astonishment, I believe you SHOULD resolve aliases in the Preferences folder (and most anywhere else, too). Your recourse is to post an error, since you don't want TWO preference files with the same name (one an alias and one not). After all, for most applications the preferences file is generated automatically on first launch, and the only way an alias prefs file can get there is for someone to explicitly put it there -- maybe he or she had a good reason. Besides, it's as simple as: "ResolveAliasFile" (see IM-VI, p.9-30) -- Marc Kaufman (kaufman@CS.Stanford.EDU) --------------------------- From: braun-eric@CS.YALE.EDU (Eric E. Braun) Subject: finding a publisher Date: 12 Feb 92 21:00:36 GMT Organization: Yale University Computer Science Dept., New Haven, CT 06520-2158 Hi, I am just finishing up a new networking product and I'm looking for a publisher. Does any of you out there who have published software before have any good sugestions for where to go looking (or where to stay away from)? Phone #s and address would be appreciated and names of people to contact would best if possible. If other folks are interested in this same info drop me a note and if there are enough of you I'll post a summary of what I get (else I'll just mail it out). Thanks in advance (as usual).. Eric - ------------------------- From: rla20@duts.ccc.amdahl.com (Roger Allen) Subject: finding a publisher Date: 12 Feb 92 23:59:55 GMT Organization: Amdahl Corporation, Sunnyvale CA In article <1992Feb12.210036.25158@cs.yale.edu> braun-eric@CS.YALE.EDU (Eric E. Braun) writes: > >Hi, I am just finishing up a new networking product and I'm looking >for a publisher. Does any of you out there who have published >software before have any good sugestions for where to go looking (or >where to stay away from)? Phone #s and address would be appreciated >and names of people to contact would best if possible. > >If other folks are interested in this same info drop me a note and if >there are enough of you I'll post a summary of what I get (else I'll >just mail it out). > >Thanks in advance (as usual).. > >Eric I would certainly like to hear other people's stories of how they got their product to market. It seems we have plenty of advice on how to get our programs to work--but, after you get your program done you are on your own! I know "in general" what to do, so I'm not too interested in the standard "write to a publisher and wait for a reply..." This leaves ALOT unanswered. For instance--how do you negotiate your fee/royalty-- this is probably something that it would be nice to know ballpark figures beforehand. Another for instance--after you sold your program to a publisher did you find out about a better deal you had overlooked? or maybe see that going it alone would have been better? Etc, etc, etc. C'mon Mac programming gurus! Let's hear how you got rich! (or not) Roger. -- > Roger Allen | The preceding message was written < > Amdahl Computer Development | by 100 monkeys typing for 100 years. < > rla20@cd.amdahl.com | I am not responsible for the monkeys. < --------------------------- End of C.S.M.P. Digest **********************